Skip to content

feat: import datasets from scicat - #1390

Draft
olevski wants to merge 1 commit into
mainfrom
build/scicat-import
Draft

feat: import datasets from scicat#1390
olevski wants to merge 1 commit into
mainfrom
build/scicat-import

Conversation

@olevski

@olevski olevski commented Jul 22, 2026

Copy link
Copy Markdown
Member

Adds the ability to import envidat datasets into Renku.

@olevski
olevski requested review from a team, SalimKayal and sgaist as code owners July 22, 2026 12:41
@olevski
olevski marked this pull request as draft July 22, 2026 12:41
prefix=prefix,
)
)
return output[0]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not return early ? This would avoid building a whole list since only the first entry is used.

if not isinstance(doi, str):
if doi is None:
raise errors.ValidationError(
message="Cannot get configuration for Envidat data connector because "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message="Cannot get configuration for Envidat data connector because "
message="Cannot get configuration for SciCat data connector because "

"the doi is missing from the payload."
)
raise errors.ValidationError(
message=f"Cannot get configuration for Envidat data connector because the doi '{doi}' "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message=f"Cannot get configuration for Envidat data connector because the doi '{doi}' "
message=f"Cannot get configuration for SciCat data connector because the doi '{doi}' "

)
if len(doi) == 0:
raise errors.ValidationError(
message="Cannot get configuration for Envidat data connector because the doi is a string with zero length."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message="Cannot get configuration for Envidat data connector because the doi is a string with zero length."
message="Cannot get configuration for SciCat data connector because the doi is a string with zero length."

res = await clnt.get(envidat_url, headers=headers)
if res.status_code != 200:
raise errors.ValidationError(
message="Cannot get configuration for Envidat data connector because Envidat responded "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message="Cannot get configuration for Envidat data connector because Envidat responded "
message="Cannot get configuration for Scicat data connector because SciCat responded "

raise errors.ValidationError(
message="Cannot get configuration for Envidat data connector because Envidat responded "
f"with an unexpected {res.status_code} status code at {res.url}.",
detail=f"Response from envidat: {res.text}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
detail=f"Response from envidat: {res.text}",
detail=f"Response from SciCat: {res.text}",



def create_scicat_metadata_url(doi: models.DOI) -> str:
"""Create the metadata url for envidat from a DOI."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Create the metadata url for envidat from a DOI."""
"""Create the metadata url for SciCat from a DOI."""



def __get_rclone_s3_config_scicat(dataset: SchemaOrgDataset) -> S3Config:
"""Get the S3 rclone configuration and source path from a dataset returned by scicat.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Get the S3 rclone configuration and source path from a dataset returned by scicat.
"""Get the S3 rclone configuration and source path from a dataset returned by SciCat.

@olevski

olevski commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

@sgaist thanks for the review. This is very much still WIP. I will address your comments though. But I will remove the draft on the PR when it is ready. I apologize if I was late when marking this as draft. I think I did it right away, but maybe I forgot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants